home *** CD-ROM | disk | FTP | other *** search
/ Languguage OS 2 / Languguage OS II Version 10-94 (Knowledge Media)(1994).ISO / language / awe / awe-full.lha / Awe2 / DoNotUseThisSrc / MultiCpuMux.h < prev    next >
C/C++ Source or Header  |  1990-08-08  |  2KB  |  73 lines

  1. // This may look like C code, but it is really -*- C++ -*-
  2. // 
  3. // Copyright (C) 1988 University of Illinois, Urbana, Illinois
  4. //
  5. // written by Dirk Grunwald (grunwald@cs.uiuc.edu)
  6. //
  7. #ifndef MultiCpuMux_h
  8. #define MultiCpuMux_h
  9. #ifdef __GNUG__
  10. #  pragma once
  11. #  pragma interface
  12. #endif
  13.  
  14. #include <CpuMultiplexor.h>
  15. #include <MultiCpuMuxExceptions.h>
  16.  
  17. extern SpinLock CpuCerrLock;
  18.  
  19. class MultiCpuMux : public CpuMultiplexor {
  20.     friend class MultiSimMux;
  21. protected:
  22.  
  23.     SpinFetchAndOp *globalCurrentEventsCounter;
  24.  
  25.     int oldGeneration; // placed here to avoid optimizer screwups
  26.     //
  27.     // Constructors of this class and all subclasses should call their
  28.     // own allocateLocalEventStructures, because constructors automatically
  29.     // chain the calls.
  30.     //
  31.     // Use AllocateEventStructures when allocating resources for a CPU and
  32.     // you're not in the constructor. Use deallocateEventStructures for
  33.     // removing those resources. These routines should call subclass
  34.     // instances of the same names.
  35.     //
  36.     void allocateLocalEventStructures(int,int);
  37.  
  38.     virtual void allocateEventStructures(int,int);
  39.     virtual void deallocateEventStructures();
  40.  
  41.     //
  42.     //    like add, but adds to another CPU
  43.     //
  44.     virtual void addToAnother(int, Thread *);
  45.     virtual Thread *remove();
  46.  
  47.     //
  48.     //    Exception handlers.
  49.     //
  50.  
  51.     friend class ExceptionRelocate;
  52.     ExceptionRelocate relocateException;
  53.  
  54.     friend class ExceptionEnrollDismissCpu;
  55.     ExceptionEnrollDismissCpu enrollDismissCpuException;
  56.  
  57. public:
  58.     MultiCpuMux(int debug = 0);
  59.     virtual ~MultiCpuMux();
  60.  
  61.     virtual void fireItUp(int Cpus = 1, unsigned shared = (4196 * 500));
  62.     virtual void warmThePot(int);
  63.     virtual void stirItAround();
  64.     virtual void coolItDown();
  65.  
  66.     virtual void enrollCpu();
  67.     virtual void dismissCpu();
  68.  
  69.     virtual void add(Thread *);
  70. };
  71.  
  72. #endif /* MultiCpuMux_h */
  73.